package cn.util;
//分页的JavaBean
public class PageBean {
	private Integer pageNo=1;//当前页
	private Integer pageSize=3;//每页显示多少
	private Integer totalCount;//总记录条数
	
	private Integer totalPage;//总页数
	private Integer prevPage;//上一页
	private Integer nextPage;//下一页
	
	
	public Integer getPageNo() {
		return pageNo;
	}
	public void setPageNo(Integer pageNo) {
		this.pageNo = pageNo;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Integer getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}
	public Integer getTotalPage() {
		if(getTotalCount()%getPageSize()==0){
			return getTotalCount()/getPageSize();
		}else{
			return getTotalCount()/getPageSize()+1;
		}
	}
	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}
	public Integer getPrevPage() {
		return getPageNo()==1?1:getPageNo()-1;
	}
	public void setPrevPage(Integer prevPage) {
		this.prevPage = prevPage;
	}
	public Integer getNextPage() {
		return getPageNo()==getTotalPage()?getTotalPage():getPageNo()+1;
	}
	public void setNextPage(Integer nextPage) {
		this.nextPage = nextPage;
	}
	
	
}
